<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    </style>
</head>

<body>
    <div id="app">
        <!-- 3.使用子组件 -->
        <App></App>

    </div>
    <script src="./vue.js"></script>
    <script type='module'>
        import xxx from './modules.js';

        const App = {
            data() {
                return {
                    isShow: false
                }
            },
            methods: {
                asyncLoad() {
                    this.isShow = !this.isShow;
                }
            },
            components: {
                Test:()=>import('./Test.js')
            },
            template: `
                 <div>            
                    <button @click='asyncLoad'>异步加载</button>
                    <Test v-if='isShow'></Test>
                 </div>
            `,
        }
        new Vue({
            el: '#app',
            data: {

            },
            components: {
                App
            }

        })
    </script>
</body>

</html>